package com.changpay.zywy.mvp.presenter

import com.changpay.zywy.base.BasePresenter
import com.changpay.zywy.ext.ss
import com.changpay.zywy.mvp.contract.RegisterContract
import com.changpay.zywy.mvp.model.registerModel


/**
 * Created by chenxz on 2018/5/27.
 */
class RegisterPresenter : BasePresenter<RegisterContract.Model, RegisterContract.View>(), RegisterContract.Presenter {
    override fun register(map: MutableMap<String, String>) {
        mModel?.register(map)?.ss(mModel,mView){
            mView?.registerSuccess()
        }
    }

    override fun createModel(): RegisterContract.Model? = registerModel()

    override fun getCode(phone: String, type: String) {
        mModel?.getCode(phone,type)?.ss(mModel,mView){
            mView?.getSuccess(data = it.result)
        }
    }
}